﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "GcmpModelInterface.h"
#include "IDbObject.h"
#include "ParameterProcessType.h"

namespace gcmp
{
    class ElementId;

    /// \brief 参数绑定接口
    class GCMP_MODEL_INTERFACE_EXPORT IParameterBinding : public IDbObject
    {
        DEFINE_CAST_DERIVED(gcmp::IParameterBinding, gcmp::IDbObject);

    public:
        /// \brief 得到参数定义Id
        ///
        /// \return 参数定义Id
        virtual int GetTargetParameterDefinitionId() const = 0;

        /// \brief 设置参数定义Id
        ///
        /// \param parameterId 参数定义Id
        /// \return 设置成功返回true，否则false
        virtual bool SetTargetParameterDefinitionId(int parameterId) = 0;

        /// \brief 返回驱动参数的参数定义Id
        ///
        /// \return 参数定义Id
        virtual int GetSourceParameterDefinitionId() const = 0;

        /// \brief 设置驱动参数的参数定义Id
        ///
        /// \param sourceParameterDefinitionId 参数定义Id
        /// \return 设置成功返回true，否则false
        virtual bool SetSourceParameterDefinitionId(int sourceParameterDefinitionId) = 0;

        /// \brief 返回被驱动参数绑定前的处理类型
        ///
        /// \return 参数处理类型
        virtual ParameterProcessType GetOriginalTargetParameterProcessType() const = 0;

        /// \brief 设置被驱动参数绑定前的处理类型
        ///
        /// \param parameterProcessType 处理类型
        /// \return 设置成功返回true，否则false
        virtual bool SetOriginalTargetParameterProcessType(ParameterProcessType parameterProcessType) = 0;

        /// \brief 返回驱动参数所属的文档元素的Id
        ///
        /// \return 文档元素的Id
        virtual const ElementId& GetSourceElementId() const = 0;

        /// \brief 设置驱动参数所属的文档元素
        ///
        /// \param sourceElementId 文档元素Id
        /// \return 设置成功返回true，否则false
        virtual bool SetSourceElementId(const ElementId& sourceElementId) = 0;

        
        /// \brief 判断参数绑定是否绑定了类型参数
        ///
        /// \return 绑定了类型参数返回true，否则返回false
        virtual bool IsBindingTypeParameter() const = 0;
    };
}



